﻿using System;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

/// <summary>
/// Summary description for SqlHelper
/// </summary>
public class SqlHelper
{
    public SqlHelper()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    
    public static string GetUrl(string photoId, SqlConnection conn)
    {
        SqlCommand command = new SqlCommand("select Url from Photos where PhotoId = @PhotoId", conn);

        SqlParameter paramPhotoId = new SqlParameter("@PhotoId", photoId);
        command.Parameters.Add(paramPhotoId);

        return command.ExecuteScalar() as string;
    }
}
